addOnMotionListener

abstract fun addOnMotionListener(@NonNull listener: OnMotionListener)

Registers an OnMotionListener to receive notifications when motion is detected by the device or connected sensors.

This listener is invoked when the player's motion detection system (which might use the device camera, PIR sensors, or other mechanisms) detects activity. This can be used to wake the screen, change content, or trigger other interactions based on physical presence or movement.

Remember to call removeOnMotionListener when the listener is no longer needed to prevent memory leaks.

Parameters

listener

The non-null OnMotionListener instance to register.

See also

Throws

if listener is null.